/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.ope.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Programador
 */
@Entity
@Table(name = "OPE_EXTORNO")
@NamedQueries({@NamedQuery(name = "Extorno.findAll", query = "SELECT e FROM Extorno e"), @NamedQuery(name = "Extorno.findByIdExtorno", query = "SELECT e FROM Extorno e WHERE e.idExtorno = :idExtorno"), @NamedQuery(name = "Extorno.findByCodigo", query = "SELECT e FROM Extorno e WHERE e.codigo = :codigo")})
public class Extorno implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_EXTORNO", nullable = false)
    private Long idExtorno;
    @Column(name = "CODIGO", length = 50)
    private String codigo;

    public Extorno() {
    }

    public Extorno(Long idExtorno) {
        this.idExtorno = idExtorno;
    }

    public Long getIdExtorno() {
        return idExtorno;
    }

    public void setIdExtorno(Long idExtorno) {
        this.idExtorno = idExtorno;
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idExtorno != null ? idExtorno.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Extorno)) {
            return false;
        }
        Extorno other = (Extorno) object;
        if ((this.idExtorno == null && other.idExtorno != null) || (this.idExtorno != null && !this.idExtorno.equals(other.idExtorno))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.ope.be.Extorno[idExtorno=" + idExtorno + "]";
    }

}
